import request from '@/config/axios'

export interface DeviceCheckUpkeepVO {
  id: number
  checkProjectCode: string
  checkProjectName: string
  checkMethod: string
  dictImplementationCycle: number
  dictFillingType: number
  enumeratedValues: string
  criterion: string
  remark: string
  dictEnableStatus: number
}

// 查询设备点检/保养列表
export const getDeviceCheckUpkeepPage = async (params) => {
  return await request.get({ url: `/config/device-check-upkeep/page`, params })
}

// 查询设备点检/保养详情
export const getDeviceCheckUpkeep = async (id: number) => {
  return await request.get({ url: `/config/device-check-upkeep/get?id=` + id })
}

// 新增设备点检/保养
export const createDeviceCheckUpkeep = async (data: DeviceCheckUpkeepVO) => {
  return await request.post({ url: `/config/device-check-upkeep/create`, data })
}

// 修改设备点检/保养
export const updateDeviceCheckUpkeep = async (data: DeviceCheckUpkeepVO) => {
  return await request.put({ url: `/config/device-check-upkeep/update`, data })
}

// 删除设备点检/保养
export const deleteDeviceCheckUpkeep = async (id: number) => {
  return await request.delete({ url: `/config/device-check-upkeep/delete?id=` + id })
}

// 导出设备点检/保养 Excel
export const exportDeviceCheckUpkeep = async (data) => {
  return await request.download({ url: `/config/device-check-upkeep/export-excel`, data })
}
